function SessionStorage() {
    this.test_data = {
        "part1":"123456"
        ,"part2":"abcdef"
        ,"part3":"I be BACK."
    };
    this.check_fn = [
        "setItem"
        ,"getItem"
        ,"removeItem"
        ,"clear"
    ];

    this.data = {
        "support":false
    };

    console.log("Session Storage Tester online.");

    var support = SessionStorage;

    if (support) {
        var re = false;
        var fn;
        var fn_name;
        var status;
        var hasSetItem = isFunction(support.setItem);
        if (hasSetItem) {
            var re_data = support.getItem("part3");
            if (re_data) {
                this.data.whatTheFuck = true;
            }
        }

        for (var i = 0;i<this.check_fn.length;i++) {
            status = false;
            fn_name = this.check_fn[i];
            fn = support[fn_name];
            if (isFunction(support[fn_name])) {
                try {
                    switch(fn_name) {
                        case "setItem":
                            support[fn_name]("part1",this.test_data.part1);
                            support[fn_name]("part2",this.test_data.part2);
                            status = true;
                        break;

                        case "removeItem":
                            support[fn_name]("part1");
                            status = true;
                        break;

                        case "getItem":
                            var dat = support[fn_name]("part1");
                            if (dat !== this.test_data.part1) {
                                status = false;
                            } else {
                                status = true;
                            }
                            dat = support[fn_name]("part2");
                            if(!dat) {
                                status = false;
                            } else {
                                status = true;
                            }
                        break;

                        case "clear":
                            support[fn_name]();
                            status = true;
                        break;
                    }
                }catch(err) {
                    console.log(err);
                    status = false;
                }
            }
            this.data[fn_name] = status;
        }

        if (hasSetItem) {
            support.setItem("part3",this.test_data.part3);
        }

        this.data.support = true;
    }

};

SessionStorage.prototype.name = "sessionStorage";

SessionStorage.prototype.report = function(){
    return this.data;
}

clientCollect.add(SessionStorage);
